package dev.common.service.base;

import com.github.pagehelper.PageInfo;
import com.github.pagehelper.PageRowBounds;
import dev.common.mapper.entity.Example;

import java.util.List;

/**
 * @program: JoyDev
 * @description: 分页接口
 * @author: MR.C
 * @create: 2018-02-07 16:15
 **/
public interface PagingService<T> {

    /** 
    * @Description: 根据实体属性和RowBounds进行分页查询
    * @Param: [record, rowBounds]
    * @return: java.util.List<T> 
    * @Author: Mr.Chen
    * @Date: 2018/2/7 下午4:27
    */ 
    List<T> findByRowBounds(T record, int pageNum,int pageSize);

    /** 
    * @Description: 根据example条件和RowBounds进行分页查询
    * @Param: [example, rowBounds] 
    * @return: java.util.List<T> 
    * @Author: Mr.Chen
    * @Date: 2018/2/7 下午4:27
    */ 
    List<T> findByExampleAndRowBounds(Example example, int pageNum,int pageSize);

    /** 
    * @Description:  根据实体属性和分页条件查询
     * @Param: [record, pageNum, pageSize]
    * @return: com.github.pagehelper.PageInfo<T> 
    * @Author: Mr.Chen
    * @Date: 2018/2/7 下午4:29
    */ 
    PageInfo<T> findByEntity(T record, int pageNum,int pageSize);

    /** 
    * @Description:  根据example条件和分页条件查询
    * @Param: [example, pageNum, pageSize] 
    * @return: com.github.pagehelper.PageInfo<T> 
    * @Author: Mr.Chen
    * @Date: 2018/2/7 下午4:31
    */ 
    PageInfo<T> findByExample(Example example,int pageNum, int pageSize);
}
